package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.wap.common.SqlName;
import com.financing.wap.dao.IFpHdFinancingBlindDao;
import com.financing.wap.dto.FpHdFinancingBlindDTO;
/**
 * fp_hd_financing_blind  
 * sfa活动-金融相亲表 数据访问层实现类
 * @author lisu
 *
 */
 
@Repository("fpHdFinancingBlindDao")
public class FpHdFinancingBlindDaoImpl extends BaseDaoImpl<FpHdFinancingBlindDTO, java.lang.Integer> implements IFpHdFinancingBlindDao {


	@Override
	public int insert(FpHdFinancingBlindDTO fpHdFinancingBlind) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.FpHdFinancingBlindSql.insert, fpHdFinancingBlind);
	}

	@Override
	public void update(FpHdFinancingBlindDTO fpHdFinancingBlind) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpHdFinancingBlindSql.update, fpHdFinancingBlind);
	}

	@Override
	public void updateForce(FpHdFinancingBlindDTO fpHdFinancingBlind) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpHdFinancingBlindSql.updateForce, fpHdFinancingBlind);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.FpHdFinancingBlindSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpHdFinancingBlindDTO> queryList(FpHdFinancingBlindDTO fpHdFinancingBlind) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.FpHdFinancingBlindSql.queryList, fpHdFinancingBlind);
	}

	@Override
	public int queryListCount(FpHdFinancingBlindDTO fpHdFinancingBlind) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.FpHdFinancingBlindSql.queryListCount, fpHdFinancingBlind);
	}

	@Override
	public FpHdFinancingBlindDTO loadById(Integer id) throws SQLException {
		return  (FpHdFinancingBlindDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpHdFinancingBlindSql.loadById,id);
	}

	@Override
	public Class<FpHdFinancingBlindDTO> getEntityClass() {
		return FpHdFinancingBlindDTO.class;
	}

	@Override
	public FpHdFinancingBlindDTO loadByMobile(String id) throws SQLException {
		return (FpHdFinancingBlindDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpHdFinancingBlindSql.loadByMobile,id);
	}
 	
}
